from django.urls import path, include
from rest_framework.routers import DefaultRouter


from apps.prize_system.prize.views import PrizeCategoryViewSet, PrizeLevelViewSet, PrizeRankViewSet, PrizeViewSet
from apps.common.account.views import LoginView, UserInfoView, AccountViewSet, RoleViewSet, PermissionViewSet
from apps.common.school.views import FacultyViewSet


router = DefaultRouter()

# 账号account 相关的url
router.register('account', AccountViewSet, basename='account')
router.register('role', RoleViewSet, basename='role')
router.register('permission', PermissionViewSet, basename='permission')

# 校区，院系，专业
router.register('faculty', FacultyViewSet, basename='faculty')


# 获奖管理
router.register('prize_category', PrizeCategoryViewSet, basename='prize_category')
router.register('prize_level', PrizeLevelViewSet, basename='prize_level')
router.register('prize_rank', PrizeRankViewSet, basename='prize_rank')
router.register('prize', PrizeViewSet, basename='prize')


urlpatterns = [
    path('login', LoginView.as_view()),
    path('user/info', UserInfoView.as_view()),
    path('api/', include(router.urls)),
]